package cn.com.api.mapper.base;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import com.sdicons.json.validator.impl.predicates.True;

import cn.com.api.entity.ApiU_advert_position;

//DAO
public interface U_advert_positionMapperBase {

	// 根据id查看
	@Select("SELECT * FROM U_ADVERT_POSITION  WHERE ID = #{id}")
	public ApiU_advert_position findU_advert_positionById(Integer id);

	// 查看数据集
	@Select("SELECT * FROM U_advert_position where ISPOSITION = 1 order by id desc")
	public List<ApiU_advert_position> findU_advert_positions();

	// 添加
	@Insert("INSERT INTO U_ADVERT_POSITION (POSITION_NAME, PRE_PICTURE, UNIT_PRICE, UNIT, SPEC, EXT1, EXT2, EXT3, EXT4, EXT5, PRE_PRCTURE_INN, SPEC_INN) VALUES (#{position_name}, #{pre_picture}, #{unit_price}, #{unit}, #{spec}, #{ext1}, #{ext2}, #{ext3}, #{ext4}, #{ext5}, #{pre_prcture_inn}, #{spec_inn})")
	@Options(useGeneratedKeys = true, keyProperty = "id")
	public int insertU_advert_position(ApiU_advert_position u_advert_position);

	// 修改
	@Update("UPDATE U_ADVERT_POSITION SET POSITION_NAME = #{position_name}, PRE_PICTURE = #{pre_picture}, UNIT_PRICE = #{unit_price}, UNIT = #{unit}, SPEC = #{spec}, EXT1 = #{ext1}, EXT2 = #{ext2}, EXT3 = #{ext3}, EXT4 = #{ext4}, EXT5 = #{ext5}, PRE_PRCTURE_INN = #{pre_prcture_inn}, SPEC_INN = #{spec_inn} WHERE ID = #{id}")
	public int updateU_advert_position(ApiU_advert_position u_advert_position);

	// 删除
	@Delete("DELETE FROM U_ADVERT_POSITION  WHERE ID = #{id}")
	public int deleteU_advert_position(Integer id);

	// Foreign keys revelant

	// region Indexs revelant

}
